package com.example.cloudsentinel.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;


public class FeignInterceptor implements RequestInterceptor {

    private String applicationName;

    public FeignInterceptor(String applicationName) {
        this.applicationName = applicationName;
    }


    @Override
    public void apply(RequestTemplate requestTemplate) {
        //在请求头添加 一个信息
        requestTemplate.header("applicationName", applicationName);
    }

    public String getApplicationName() {
        return applicationName;
    }
}
